<?php
namespace Model;
use Kuyuan\WqCore\Model\Model;
use Kuyuan\WqCore\util\Date;

/**
 * 提现列表
 * Class DepositModel
 * @package Model
 */
class DepositModel extends Model
{
    protected $_fields = array(
        "id",
        "uniacid",
        "order_id",
        "uid",
        "money",
        "status",
        "time"
    );

    //----set-----
    public function setTimeAttr()
    {
        return TIMESTAMP;
    }

    //-----get----
    /**
     * 获取时间
     * @param $_value
     * @return false|string
     */
    public function getTimeAttr($_value)
    {
        if($_value) {
            return Date::shortFormat($_value);
        }
    }

    /**
     * 获取提现用户信息
     */
    public function getUserAttr($_value,$_data)
    {
        if(isset($_data["uid"])) {
            return W7McMembersModel::where("uid",$_data["uid"])
                ->field(array("avatar","nickname"))
                ->cache(!KUYUAN_DEBUG)
                ->find();
        }
    }
}